﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;

namespace BasisMgr
{
    public partial class rptUserAll : DevExpress.XtraReports.UI.XtraReport
    {
        public rptUserAll()
        {
            InitializeComponent();

           xcDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
        }

        private void xrSubreport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            dsUserInfo dsUser = new dsUserInfo();

            string sUserID = GetCurrentColumnValue("UserID").ToString();
           // T_RewardPunish mRewardPunish = new T_RewardPunish();
           // DataTable dtRewardPunish = mRewardPunish.GetList(" and UserID='" + sUserID + "'").Tables[0];
           // for (int i = 0; i < dtRewardPunish.Rows.Count; i++)
           // {
           //     DataRow drRewardPunish = dsUser.dtRewardPunish.Rows.Add();
           //     drRewardPunish["StartDate"] = dtRewardPunish.Rows[i]["StartDate"].ToString();
           //     drRewardPunish["EndDate"] = dtRewardPunish.Rows[i]["EndDate"].ToString();
           //     drRewardPunish["RPName"] = dtRewardPunish.Rows[i]["RPName"].ToString();
           //     drRewardPunish["RPContent"] = dtRewardPunish.Rows[i]["RPContent"].ToString();
           //     drRewardPunish["RPTypeName"] = dtRewardPunish.Rows[i]["RPTypeName"].ToString();
           // }
           //((rpUserReward)((XRSubreport)sender).ReportSource).DataSource  = dsUser;
        }

        private void xrSubreport2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            dsUserInfo dsUser = new dsUserInfo();

            string sUserID = GetCurrentColumnValue("UserID").ToString();

            //T_FeedBack mFeedBack = new T_FeedBack();
            //DataTable dtFeedBack = mFeedBack.GetList(" and UserID='" + sUserID + "'").Tables[0];
            //for (int iFeedBack = 0; iFeedBack < dtFeedBack.Rows.Count; iFeedBack++)
            //{
            //    DataRow drFeedBack = dsUser.dtFeedBack.Rows.Add();
            //    drFeedBack["FBDate"] = dtFeedBack.Rows[iFeedBack]["FBDate"].ToString();
            //    drFeedBack["FBModeName"] = dtFeedBack.Rows[iFeedBack]["FBModeName"].ToString();
            //    drFeedBack["FBTypeName"] = dtFeedBack.Rows[iFeedBack]["FBTypeName"].ToString();
            //    drFeedBack["FBContent"] = dtFeedBack.Rows[iFeedBack]["FBContent"].ToString();
            //    drFeedBack["UserID"] = dtFeedBack.Rows[iFeedBack]["UserID"].ToString();
            //}

            ((rptFeedBack)((XRSubreport)sender).ReportSource).DataSource = dsUser;
        }

    }
}
